Skip to content

Document and expose API warnings - #36

Merged
michaelfox merged 1 commit into
mainfrom
warnings-support
Oct 5, 2026
Merged

michaelfox merged 1 commit into
mainfrom
warnings-support

Conversation

@michaelfox

Copy link
Copy Markdown
Contributor

The Geocodio API reports non-fatal advisories under a _warnings key, for example a misspelled field name, an unexpected query parameter, a superseded API version, or an append that had to be skipped. Until now, the only way to get at them was GeocodingResponse.raw, and list and distance matrix job responses dropped them completely.

Changes

  • Models: GeocodingResponse, GeocodingResult, ListResponse, DistanceJobResponse and PaginatedResponse now have a warnings: List[str] field, which is empty when the API sent none.
    • Batch requests: each GeocodingResult.warnings holds the warnings for its own query plus the result's own warnings. GeocodingResponse.warnings holds every warning from the batch, with duplicates removed.
  • Exceptions: GeocodioError.warnings (backed by GeocodioErrorDetail.warnings) exposes warnings attached to error responses. The new constructor argument is optional, so existing code keeps working.
  • README: new Warnings section.
  • Tests: added tests/unit/test_warnings.py, which covers every response shape, error responses, and non-JSON error bodies.

All new fields have defaults, so this change is backwards compatible.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@michaelfox
michaelfox merged commit a0ed5ad into main Oct 5, 2026
1 check passed
@michaelfox michaelfox self-assigned this Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants